

IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'$(Login)')
BEGIN
	CREATE LOGIN [$(Login)] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
END
GO

USE [$(DatabaseName)]
GO

IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(Login)')
BEGIN
	CREATE USER [$(Login)] FOR LOGIN [$(Login)] WITH DEFAULT_SCHEMA=[dbo]
END
GO

EXEC sp_addrolemember N'$(Role)', N'$(Login)'


